function cond=armijo(a,x,p,c,f0,f1)
% function to check whether the provided steplength satisfies Armijo 
% condition: f(x+ap)\le f(x)+ca \nabla f^T p
% INPUT:
%       a-current steplength (1*1);
%       x-current iterate (n*1);
%       p-search direction (n*1);
%       c-constant provided by the user (1*1);
%       f0-function handle of the objective function (Rn->R);
%       f1-the gradient of the function (Rn->Rn);
% OUTPUT:
%       cond-1 or 0 to present whether the condition holds;
% REVISION:
%       jqin, 15/feb/2011, created
if f0(x+a*p)<=f(x)+c*a*f1(x)'*p
    cond=1;
else 
    cond=0;
end
end
